package com.gin.kotlin.gf2gamecommunity.base.enums

import android.content.Context
import com.gin.kotlin.gf2gamecommunity.base.util.isWifiConnected

/**
 * 图片显示策略
 * @param des String
 * @constructor
 */
enum class ImageShow(val des: String) {
    WIFI("Wifi下显示"),
    ALWAYS("总是显示"),
    NEVER("不显示"),
    ;

    /**
     * 是否显示图片
     * @param context Context
     * @return Boolean
     */
    fun show(context: Context) = this == ALWAYS || (this == WIFI && context.isWifiConnected())
}